::-moz-color-swatch

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

The ::-moz-color-swatch CSS pseudo-element is a Mozilla extension that represents the color selected in an <input> of type="color".

Note: Using ::-moz-color-swatch with anything but an <input type="color"> doesn't match anything and has no effect.

Syntax

css
::-moz-color-swatch {
  /* ... */
}

Examples

HTML

html
<input type="color" value="#de2020" />

CSS

css
input[type="color"]::-moz-color-swatch {
  border-radius: 10px;
  border-style: none;
}

Result

Specifications

Not part of any standard.

Browser compatibility

See also

  • Similar pseudo-elements used by other browsers: